﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using BusinessLayer;
using System.Windows.Forms;
using System.IO;


namespace Design
{
    public partial class WebForm6 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (User.IsInRole("administrator") || User.IsInRole("manager") || User.IsInRole("employee"))
            {
                //lblUsersname.Text = "Hi " + Convert.ToString(Membership.GetUser(User.Identity.Name));
                hplAdmin.Visible = true;
                hplAdmin.Enabled = true;
            }
            else
            {
                hplAdmin.Visible = false;
                hplAdmin.Enabled = false;
            }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            //    //SearchEng search = new SearchEng();
            //    //List<SearchEng> objsrch = new List<SearchEng>();
            //    //objsrch = search.get_seacrh_engine();

            //    int count = objsrch.Count();
            //    for (int i = 0; i < count; i++)
            //    {

            //        if (txtsearch.Text == objsrch[i].Name)
            //        {

            //            try
            //            {

            //            }
            //            catch
            //            {
            //                MessageBox.Show("Equipment does not exist!", "Search Equipment", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //            }

            //        }
            //    }

            //        Response.Redirect("SearchEngine.aspx");
        }
        //nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
        
        //public override void RegisterArea(AreaRegistrationContext context)
        //{
        //    // By default there is no "controller" parameter in the following line. 
        //    // Add one referencing "Home" as shown.
        //    context.MapRoute(
        //        "Mobile_default",
        //        "Mobile/{controller}/{action}/{id}",
        //        new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        //    );
        //}

        ///NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
        //public static void RegisterRoutes(RouteCollection routes)
        //{
        //    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        //    routes.MapRoute(
        //        "Default",
        //        "{controller}/{action}/{id}",
        //        new { controller = "Home", action = "Index", id = UrlParameter.Optional },
        //        // Add the namespace of your desktop controllers here
        //        new[] { "YourApplication.Controllers" }
        //    );
        //}
    }
}